package org.springblade.upgrade.constant;

import java.util.HashMap;
import java.util.Map;

public class PortConstant {
    private static Map<String, String> portMap = new HashMap<>();

    static {
        portMap.put("blade-gateway", "13031");
        portMap.put("blade-auth", "13032");
        portMap.put("blade-log", "13033");
        portMap.put("blade-resource", "13034");
        portMap.put("blade-desk", "13035");
        portMap.put("blade-flow-design", "13036");
        portMap.put("blade-system", "13037");
        portMap.put("blade-user", "13038");
        portMap.put("blade-flow", "13040");
        portMap.put("pub-plat-public", "13041");
        portMap.put("blade-pub-plat-quality", "13042");
        portMap.put("pub-plat-logistics", "13043");
        portMap.put("pub-plat-fis", "13044");
        portMap.put("pub-plat-produce", "13045");
        portMap.put("pub-plat-equipment", "13046");
        portMap.put("pub-plat-andon", "13047");
        portMap.put("pub-plat-spare", "13048");
        portMap.put("pub-plat-human", "13050");
        portMap.put("pub-plat-energy", "13051");
        portMap.put("tj-anaylsis", "13052");
        portMap.put("pub-plat-hse", "13053");
        portMap.put("pub-plat-dashboard", "13054");
        portMap.put("blade_test", "16000");
    }

    /**
     * 取得默认端口
     * @param serverName
     * @return
     */
    public static String getPort(String serverName) {
        String port = portMap.get(serverName);
        if (port == null) {
            return "";
        }
        return port;
    }
}
